package com.fruitshop.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.fruitshop.entity.Category;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 分类Mapper接口
 */
@Mapper
public interface CategoryMapper extends BaseMapper<Category> {
    
    /**
     * 查询所有启用的分类
     */
    @Select("SELECT id, title, sort, status, create_time, update_time FROM category WHERE deleted = 0 ORDER BY sort ASC")
    List<Category> findAllActiveCategories();
} 